package com.crr;

import java.util.HashMap;
import java.util.Map;

public class CharacterFactory {
    private Map<java.lang.Character, CharacterImpl> flyWeights =new HashMap<>();

    public Character getCharacter(char symbol){
        if(!flyWeights.containsKey(symbol)){
            flyWeights.put(symbol,new CharacterImpl(symbol));
        }
        return flyWeights.get(symbol);
    }
}
